package com.hydl.power.mapper;

import com.hydl.power.pojo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PowerdataMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Powerdata record);

    int insertSelective(Powerdata record);

    List<Powerdata> selectByExample(PowerdataExample example);

    Powerdata selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Powerdata record);

    int updateByPrimaryKey(Powerdata record);

    List getpowerData(String sn);
    List getpowerData2Min(String sn);

    Powerdata getPowerDataByCreateTime(String deviceId,Long createtime);

    /**
     * 根据时间id获取list
     * @param deviceId
     * @param createTime
     * @return
     */
    List<Powerdata> listByDeviceIdAndCreateTime(@Param("deviceId") String deviceId, @Param("createTime") Long createTime);

    Powerdata getPowerDataByDeviceId(String sn);

    List<Powerdata> queryPowerData(String deviceId,String time,String dataType,String tableName);

    List<Powerdata> queryPowerDataHalfhour(String deviceId,String time,String dataType,String tableName);

    /*<!--查詢所有设备-->*/
    List<Powerdata> queryProwerAllDevices( @Param("pageNumKey")Integer pageNum,@Param("pageSizeKey")Integer pageSize,String time, String tableName);
    /*所有设备数据导出*/
    List<Powerdata> queryPowerAllExport(Integer size,String time, String tableName);


    /*查询昨天得数据*/
    List<Powerdata> queryYesterday(String deviceId,String time,String dataType);

    PowerNewData getPowerUaDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerUbDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerUcDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerUabDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerUbcDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerUcaDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerIaDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerIbDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerIcDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerPtDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerPtnDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerPtinDataByDeviceId(@Param("deviceId")String deviceId,@Param("tableName")String tableName);

    PowerNewData getPowerPtfDataByDeviceId(@Param("deviceId")String deviceId ,@Param("tableName")String tableName);

    String queryMonthLoopType(String sn,String createTime);

    String queryYearLoopType(String sn,String createTime);

    Powerdata queryPowerDataDay(String tableName,String sn);

    Powerdata queryPowerDataOneDay(String tableName,String sn);

    Powerdata queryPowerDataDeviceDay(String tableName,String sn);

    List<ElectricityBill> getElectricityBill(String deviceId, String time);

    List<ElectricityBill> getElectricityBillByProjectId(String projectId, String time);

    List<ElectricityBill> getMonthElectricityBill(String projectId, String time);

    List<Powerdata>queryePowerPermutation(String tableName,String startTime);

    List<ElectricityBill> getElectricityFees(String deviceId, String time);

    List<ElectricityBill> getElectricityFeesByProjectId(String projectId, String time);

    List<ElectricityBill> getMonthElectricityBillByTableName(String time, String tableName);

    List<Powerdata> getPowerDataBySerialNumber(String serialNumber, String time, String tableName);

    List<PowerConsume> getPowerDataByMonth(String startTime, String endTime, String projectId, String tableName);
}
